home *** CD-ROM | disk | FTP | other *** search
-
-
-
- strtol User Commands strtol
-
-
-
- _________________________________________________________________
-
- NNAAMMEE
- strtol, strtoul - Convert character string to integer
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssttddlliibb..hh>>
-
- lloonngg iinntt
- ssttrrttooll((_s_t_r_i_n_g, _e_n_d_P_t_r, _b_a_s_e)
-
- uunnssiiggnneedd lloonngg iinntt
- ssttrrttoouull((_s_t_r_i_n_g, _e_n_d_P_t_r, _b_a_s_e)
-
- AARRGGUUMMEENNTTSS
- char *_s_t_r_i_n_g (in) String containing ASCII
- representation of integer.
-
- char **_e_n_d_P_t_r (out) If not NNUULLLL, gives address of
- pointer to fill in with address
- of first character in _s_t_r_i_n_g
- following integer.
-
- int _b_a_s_e (in) Base to use for conversion; see
- below for explanation. Must be
- between 0 and 36, inclusive.
-
- _________________________________________________________________
-
-
- DDEESSCCRRIIPPTTIIOONN
- The ssttrrttooll and ssttrrttoouull procedures convert a character string
- to its corresponding integer representation and return the
- integer value. Both procedures expect _s_t_r_i_n_g to point to a
- sequence of digits, optionally preceded by any amount of
- white space (as defined by the iissssppaaccee procedure). SSttrrttooll
- also permits the digits to be preceded immediately by a
- minus sign, in which case the result is a negative integer.
-
- If _b_a_s_e is between 2 and 36, inclusive, then the permissible
- ``digits'' of the string consist of the first _b_a_s_e charac-
- ters in the set 00 through 99 and aa through zz (or AA through
- ZZ). The integer result will be calculated using _b_a_s_e as the
- radix for conversion. If the value of _b_a_s_e is 16, then the
- characters 00xx or 00XX may precede the digits, following the
- sign if it is present.
-
- If _b_a_s_e is 0, then the radix for conversion is chosen based
- on the initial digits of the number. If the initial digits
- are 00xx or 00XX, then base 16 will be used for conversion;
- otherwise if the first digit is 00 then base 8 will be used
- for conversion; otherwise base 10 will be used.
-
- SSttrrttooll and ssttrrttoouull convert as many characters as possible
-
-
-
- Sprite v.1.0 Printed: April 15, 1989 1
-
-
-
-
-
-
- strtol User Commands strtol
-
-
-
- from _s_t_r_i_n_g, and return in *_e_n_d_P_t_r the address of the first
- character not forming a valid portion of the number. If no
- conversion could be performed (_s_t_r_i_n_g was empty, or did not
- point to a number in the expected form), then _s_t_r_i_n_g will be
- stored in *_e_n_d_P_t_r and zero is returned.
-
-
- KKEEYYWWOORRDDSS
- base, convert, integer, radix, string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v.1.0 Printed: April 15, 1989 2
-
-
-
-